import { get, del, post, put } from "../utils/request"

export function listApi(page = 1) {
    return get('/admin/products', { page, per: 4 });
}

export function createApi(data) {
    return post('/admin/products/add', data)
}

export function modifyOne(id, data) {
    return put(`/admin/products/${id}`, data)
}

export function delOne(id, data) {
    return del(`/admin/products/${id}`, data)
}

export function selectOne(id) {
    return get(`/admin/products/select`)
}